10th international ABINIT developer workshop
May 31 - June 4, 2021 - Smart Working, Lockdown

Use the Space key to navigate through all slides.

NB: AbiPy relies on pymatgen but it be interfaced with other tools (e.g ASE, phonopy, etc) via converters
Using conda and the conda forge channel (recommended):
conda install abipy --channel conda-forge
Recipes for AbiPy and ABINIT are now supported by the conda-forge community 🎉
This means that:
Since conda is not limited to python packages, one can easily install ABINIT in the same env with:
conda install abinit -c conda-forge
Using pip and python wheels:
pip install abipy --user
From the github repository (develop mode):
git clone https://github.com/abinit/abipy.git
cd abipy
python setup.py develop
For further info see http://abinit.github.io/abipy/installation.html
%embed https://abinit.github.io/abipy/index.html
%embed https://abinit.github.io/abipy/gallery/plot_phbands_nkpt_tsmear.html#sphx-glr-gallery-plot-phbands-nkpt-tsmear-py
%embed https://nbviewer.jupyter.org/github/abinit/abitutorials/blob/master/abitutorials/index.ipynb
New Flows to compute:
New flows and post-processing tools for:
NB: There's an ongoing effort to reimplement AbiFlows in terms of the atomate framework so this talk will mainly discuss the features available in abipy.flowtk.
(contributed by G. Petretto)
Based on py script by A. Romero. ...
Applications:
Example: obtain irreps from DDB using phonopy
For the formalism, see:
scf_input = make_scf_input() # Build input for GS calculation
elast_work = flowtk.ElasticWork.from_scf_input(scf_input,
with_relaxed_ion=True,
with_piezo=True)

elastic_ddb = abilab.abiopen("elastic_DDB")
edata = elastic_ddb.anaget_elastic()
edata.elastic_relaxed
| xx | yy | zz | yz | xz | xy | |
|---|---|---|---|---|---|---|
| Voigt index | ||||||
| xx | 135.262182 | 54.450376 | 38.052927 | 0.00000 | 0.000000 | 0.000000 |
| yy | 54.450376 | 135.262181 | 38.052927 | 0.00000 | 0.000000 | 0.000000 |
| zz | 38.052927 | 38.052926 | 148.211029 | 0.00000 | 0.000000 | 0.000000 |
| yz | 0.000000 | 0.000000 | 0.000000 | 30.55071 | 0.000000 | 0.000000 |
| xz | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 30.550709 | 0.000000 |
| xy | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | 40.405903 |
edata.get_elastic_properties_dataframe(properties_as_index=True)
| property | 0 | 1 | |
|---|---|---|---|
| 0 | trans_v | 3.194459e+03 | 3.838052e+03 |
| 1 | long_v | 5.796035e+03 | 6.295200e+03 |
| 2 | snyder_ac | 5.767044e+01 | 8.693459e+01 |
| 3 | snyder_opt | 3.158141e-01 | 3.621134e-01 |
| 4 | snyder_total | 5.798626e+01 | 8.729670e+01 |
| 5 | clarke_thermalcond | 7.734051e-01 | 9.006348e-01 |
| 6 | cahill_thermalcond | 8.539415e-01 | 9.791319e-01 |
| 7 | debye_temperature | 3.760623e+02 | 4.477874e+02 |
| 8 | k_voigt | 7.553865e+01 | 7.553930e+01 |
| 9 | k_reuss | 7.553074e+01 | 7.553579e+01 |
| 10 | k_vrh | 7.553469e+01 | 7.553754e+01 |
| 11 | g_voigt | 3.951341e+01 | 5.767416e+01 |
| 12 | g_reuss | 3.761300e+01 | 5.366047e+01 |
| 13 | g_vrh | 3.856321e+01 | 5.566731e+01 |
| 14 | universal_anisotropy | 2.527308e-01 | 3.740360e-01 |
| 15 | homogeneous_poisson | 2.818554e-01 | 2.041909e-01 |
| 16 | y_mod | 9.886491e+10 | 1.340681e+11 |
edata.get_elastic_voigt_dataframe(tol=1e-5)
| voigt_cinds | elastic_relaxed | elastic_clamped | |
|---|---|---|---|
| 0 | (0, 0) | 135.262182 | 165.988592 |
| 1 | (0, 1) | 54.450376 | 40.464803 |
| 2 | (0, 2) | 38.052927 | 21.090298 |
| 3 | (0, 3) | 0.000000 | 0.000000 |
| 4 | (0, 4) | 0.000000 | 0.000000 |
| 5 | (0, 5) | 0.000000 | 0.000000 |
| 6 | (1, 0) | 54.450376 | 40.464802 |
| 7 | (1, 1) | 135.262181 | 165.988592 |
| 8 | (1, 2) | 38.052927 | 21.090299 |
| 9 | (1, 3) | 0.000000 | 0.000000 |
| 10 | (1, 4) | 0.000000 | 0.000000 |
| 11 | (1, 5) | 0.000000 | 0.000000 |
| 12 | (2, 0) | 38.052927 | 21.090298 |
| 13 | (2, 1) | 38.052926 | 21.090298 |
| 14 | (2, 2) | 148.211029 | 182.585743 |
| 15 | (2, 3) | 0.000000 | 0.000000 |
| 16 | (2, 4) | 0.000000 | 0.000000 |
| 17 | (2, 5) | 0.000000 | 0.000000 |
| 18 | (3, 0) | 0.000000 | 0.000000 |
| 19 | (3, 1) | 0.000000 | 0.000000 |
| 20 | (3, 2) | 0.000000 | 0.000000 |
| 21 | (3, 3) | 30.550710 | 40.818194 |
| 22 | (3, 4) | 0.000000 | 0.000000 |
| 23 | (3, 5) | 0.000000 | 0.000000 |
| 24 | (4, 0) | 0.000000 | 0.000000 |
| 25 | (4, 1) | 0.000000 | 0.000000 |
| 26 | (4, 2) | 0.000000 | 0.000000 |
| 27 | (4, 3) | 0.000000 | 0.000000 |
| 28 | (4, 4) | 30.550709 | 40.818195 |
| 29 | (4, 5) | 0.000000 | 0.000000 |
| 30 | (5, 0) | 0.000000 | 0.000000 |
| 31 | (5, 1) | 0.000000 | 0.000000 |
| 32 | (5, 2) | 0.000000 | 0.000000 |
| 33 | (5, 3) | 0.000000 | 0.000000 |
| 34 | (5, 4) | 0.000000 | 0.000000 |
| 35 | (5, 5) | 40.405903 | 62.761895 |
For additional info, see the notebook tutorial:
scf_input = make_scf_input() # Build input for GS calculation
# NB: k-mesh in gs_inp and ngqpt q-mesh must be commensurate.
from abipy.flowtk.gruneisen import GruneisenWork
voldelta = gs_inp.structure.volume * 0.02
work = GruneisenWork.from_gs_input(gs_inp, voldelta, ngqpt=[2, 2, 2], with_becs=False)

For the formalism see:
scf_input = make_scf_input() # Get the SCF input (without SOC)
scf_input = make_scf_input()
return flowtk.NonLinearCoeffFlow.from_scf_input("nlo_flow", scf_input)

For the formalism see:
scf_input = make_scf_input() # Get the SCF input (without SOC)
from abipy.flowtk.effmass_works import EffMassAutoDFPTWork
flow = flowtk.Flow("effmass_flow")
work = EffMassAutoDFPTWork.from_scf_input(scf_input)
flow.register_work(work)

This example shows how to compute the e-ph matrix elements in AlAs along a q-path with AbiPy flows. The final results are stored in the GKQ.nc file (one file for q-point) in the outdata of each task.
# Build input for GS calculation on a 2x2x2 k-mesh
scf_input = make_scf_input(ngkpt=(2, 2, 2))
# q-mesh for phonons
ngqpt = (2, 2, 2)
# Create flow to compute all the independent atomic perturbations
# Use ndivsm = 0 to pass an explicit list of q-points.
# If ndivsm > 0, qpath_list is interpreted as a list of boundaries for the q-path
qpath_list = [[0.0, 0.0, 0.0], [0.01, 0, 0], [0.1, 0, 0],
[0.24, 0, 0], [0.3, 0, 0], [0.45, 0, 0], [0.5, 0.0, 0.0]]
from abipy.flowtk.eph_flows import GkqPathFlow
flow = GkqPathFlow.from_scf_input("flow_dir", scf_input,
ngqpt, qpath_list, ndivsm=0, with_becs=True,
ddk_tolerance={"tolwfr": 1e-8})
Formalism:
https://abinit.github.io/abipy/flow_gallery/run_gkq.html#sphx-glr-flow-gallery-run-gkq-py



gsr = abiopen("si_nscf_GSR.nc")
gsr.ebands.plot(with_gaps=True);
(contributed by Y. He and MG)
gsr.ebands.plotly(with_gaps=True); # object.plot becomes object.plotly
gsr.ebands.plotly(with_gaps=True, chart_studio=True);

Now users can finally customize the plot without changing the py code.
gsr.ebands.kpoints.plotly();
gsr.ebands.kpoints.plot();
Several other plotting libraries are available in the pydata ecosystem

Thanks to this infrastructure, developers can

To build a panel GUI inside the notebook, use:
ddb = abilab.abiopen("ZnSe_hex_qpt_DDB")
abilab.abipanel(); # Important
ddb.get_panel()
ddb.structure.get_panel()
To create a panel dashboard associated to the DDB file, use:
abiopen.py out_DDB --panel # or -pn if you prefer the short version.

abiopen.py mgb2_kpath_FATBANDS.nc --expose --seaborn
abiopen.py mgb2_kpath_FATBANDS.nc --expose-web # -ewb
abiopen.py mgb2_kpath_FATBANDS.nc --plotly # -ply

to get a quick look at the results
abiview.py ddb ZnSe_hex_qpt_DDB --panel # or -pn if you prefer the short version.
## Documentation of new features available at:
%embed https://abinit.github.io/abipy/graphical_interface.html
abiview.py ddb ZnSe_hex_qpt_DDB --seaborn
Use AbiPy programmatic interface to implement: